/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ru.miit.elearning.servlets.security;

import java.io.IOException;
import javax.servlet.*;
import javax.servlet.http.*;

public class LogoutServlet extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest request,
            HttpServletResponse response) throws ServletException, IOException {

        //request.logout();
//        response.setHeader("Cache-Control", "no-cache"); //Forces caches to obtain a new copy of the page from the origin server
//        response.setHeader("Cache-Control", "no-store"); //Directs caches not to store the page under any circumstance
//        response.setDateHeader("Expires", 0); //Causes the proxy cache to see the page as "stale"
//        response.setHeader("Pragma", "no-cache"); //HTTP 1.0 backward compatibility

        request.getSession().invalidate();
        response.sendRedirect("./");
    }
}
